﻿Imports System.Windows
Imports System.ServiceModel
Imports SharedTools

<ServiceBehavior(InstanceContextMode:=InstanceContextMode.Single)>
Public Class MessagesService
    Implements IMessagesService

    Public Function SendCertificateRequest(r As String) As String Implements IMessagesService.SendCertificateRequest
        Return CertificateRequestManager.ProcessCertificateRequest(r)
    End Function

    Public Function IsCertificateReady(r As String) As String Implements IMessagesService.IsCertificateReady
        Return CertificateRequestManager.IsCertificateReady(r)
    End Function

    Public Function DownloadCRL(r As String) As String Implements IMessagesService.DownloadCRL
        Return CRLManager.DownloadCRL(r)
    End Function

    Public Function SendRenewalRequest(r As String) As String Implements IMessagesService.SendRenewalRequest
        Return CertificateRequestManager.RenewCertificates(r)
    End Function

    Public Function SendRevocationRequest(r As String) As String Implements IMessagesService.SendRevocationRequest
        Return CRLManager.RevokeCertificate(r)
    End Function

    Public Function SendOCSPQuery(r As String) As String Implements IMessagesService.SendOCSPQuery
        Return CRLManager.OCSPquery(r)
    End Function

    Public Function DownloadUserCertificate(r As String) As String Implements IMessagesService.DownloadUserCertificate
        Return CertificatesManager.CertificateDownloadRequest(r)
    End Function
End Class
